# -*- coding: utf-8 -*-
<%inherit file="/admin.mako"/>
<%def name="sim_nao(sn)">
  %if sn == 0:
N&atilde;o
  %else:
Sim
  %endif
</%def>
<p style="text-align: center"><span class="destak">Vota&ccedil;&otilde;es</span></p>
${h.form(h.url(action='',id=None),method='post')}
<div id="list" class="inner_context">
  <table class="tablelist" width="100%" cellpadding="0" cellmargin="0">    
    <tbody class="ligth_gray">
      <tr>
        <td align="right" width="30%">Mostrar vota&ccedil;&otilde;es do dia</td>
        <td width="*">${h.text_field('dt',class_='ed',size='10',value=c.dt or h.str_date(h.today()))} (dd/mm/aaaa)</td>
      </tr>
    </tbody>
  </table>
<br/>
${h.submit(value=' Mostrar ',class_='ed')}
</div>
${h.end_form()}
<br/>
<div id="list" class="inner_context">
<span class="destak">[</span><a href="${h.url_for(action='edit',id=None)}">Adicionar</a><span class="destak">]</span>
  <table class="tablelist" width="100%" cellpadding="0" cellmargin="0">    
    <thead>
      <tr>
        <th width="10%" align="left">Data</th>
        <th width="75%" align="left">Mostra</th>
        <th width="15%">Ativo</th>
      </tr>
    </thead>
    <tbody class="ligth_gray">
%if c.list:
    %for votacao in c.list:
        <tr>
          <td>${h.str_date(votacao.dtvotacao)}</td>
          <td><a href="${h.url_for(action='edit',id=votacao.cdvotacao)}">${votacao.r_mostra.nmmostra}</a></td>
          <td><span class="destak">[</span><a href="${h.url_for(action='activate',id=votacao.cdvotacao)}">${sim_nao(votacao.flativa)}</a><span class="destak">]</span></td>
        </tr>
    %endfor
%endif
    </tbody>
  </table>
</div>
